import java.io.*;

public class Test1 {
    public static void main(String[] args) throws IOException {
        //create();
        //del();
        move();
    }

    public static  void create()  {
        File f1=new File("d:/001/a");
        try {
            f1.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println(f1.mkdir());//判断是否创建成功
        System.out.println(f1.mkdirs());
    }
    public static void del()
    {
        File f1=new File("d:/001");
        System.out.println(f1.delete());
    }

    public static void move() throws IOException {
        File f1=new File("d:/0/1.txt");
        File f2=new File("d:/0/2.txt");
        f1.mkdirs();
        f2.mkdirs();
        System.out.println(f1.renameTo(f2));
    }
}
